Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add isTransferring check to transfer hook examples #84

Merged
merged 9 commits into from
Jun 12, 2024

Conversation

Woody4618
Copy link
Collaborator

This check checks the source token account if it is currently transferring to make sure that the transfer hook can only be called during a transfer.
This is to make sure that for example a counter or similar can not be manipulated by calling the transfer hook directly.

@Woody4618 Woody4618 changed the title Add Check transferring flag to transfer hook examples Add isTransferring check to transfer hook examples Jun 12, 2024
@Woody4618 Woody4618 requested a review from ZYJLiu June 12, 2024 10:20
Copy link
Collaborator

@ZYJLiu ZYJLiu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update the cargo.toml dependency from

anchor-lang = { git = "https://github.com/coral-xyz/anchor", branch = "master",features = ["interface-instructions"] }
anchor-spl = { git = "https://github.com/coral-xyz/anchor", branch = "master" }

back to

anchor-lang = { version = "0.30.0", features = ["interface-instructions"] }
anchor-spl = "0.30.0"

looks good and learned that TransferHookAccount state existed!

@ZYJLiu ZYJLiu merged commit dc25914 into main Jun 12, 2024
13 checks passed
@Woody4618
Copy link
Collaborator Author

Thank you :)

@Woody4618 Woody4618 deleted the check-transferring-flag branch June 12, 2024 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants